/*
 * Copyerror 2004-2005 asoft
 * 本软件及其所有拷贝的名称，与光盘上或本软件中注明的公司同在。
 * 本软件及文档享有版权，并受国家版权法及国际协约条款的保护。
 * 您不可以从本软件中去掉其版权声明；并保证为本软件的拷贝（本部或部分）* 复制版权声明。
 * 您同意制止以任何形式非法拷贝本软件及文档。
 * 版权信息参见：
 *      http://www.asoft.cn/licenses
 */

package com.asoft.examonline.exammanager.model;

import java.io.Serializable;

import com.asoft.common.base.model.BaseObject;

/**
 * <p>Title: 答案</p>
 * <p>Description: TransferObject </p>
 * <p>Copyerror: Copyerror (c) 2003</p>
 * <p>Company: asoft</p>
 * @ $Author: author $
 * @ $Date: 2004/12/17 13:54:17 $
 * @ $Revision: 1.4 $
 * @ created in 2007-2-20
 *
 */

public class Result extends BaseObject
                       implements Serializable
{
        private ExamQuestion examQuestion;
        
        private String content;
        
        private boolean error;
        /**
         * 构造函数
         */
        public Result()
        {
                this.error = true;
        }
        
        public Result(ExamQuestion examQuestion, String content, boolean error)
        {
                super();
                this.examQuestion = examQuestion;
                this.content = content;
                this.error = error;
        }

        /**
         * @return content
         */
        public String getContent()
        {
                return content;
        }
        
        public String getNotNewLineContent()
        {
                String c = this.content;
                c = c.replaceAll("<p>", "");
                c = c.replaceAll("</p>", "");
                return c;
        }

        /**
         * @param content 要设置的 content
         */
        public void setContent(String content)
        {
                this.content = content;
        }

        /**
         * @return error
         */
        public boolean isError()
        {
                return error;
        }
        
        public boolean isRight()
        {
                return !error;
        }
        
        public String getRightErrorName()
        {
                if(this.isError())
                {
                        return "错误";
                }
                else
                {
                        return "正确";
                }
        }

        /**
         * @param error 要设置的 error
         */
        public void setError(boolean error)
        {
                this.error = error;
        }    

        public void setRight(boolean right)
        {
                this.error = !right;
        }

        /**
         * @return examQuestion
         */
        public ExamQuestion getExamQuestion()
        {
                return examQuestion;
        }

        /**
         * @param examQuestion 要设置的 examQuestion
         */
        public void setExamQuestion(ExamQuestion examQuestion)
        {
                this.examQuestion = examQuestion;
        }
        
}
